package com.an.java.javaall.oj;

import java.util.*;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int len = Integer.parseInt(scanner.nextLine());
        String heightStr = scanner.nextLine();
        String weightStr = scanner.nextLine();
        if (len <= 0) {
            return;
        }
        List<Integer> heights = Arrays.stream(heightStr.split(" ")).map(Integer::parseInt).collect(Collectors.toList());
        List<Integer> weights = Arrays.stream(weightStr.split(" ")).map(Integer::parseInt).collect(Collectors.toList());
        List<Student> students = new ArrayList<>();
        for (int i = 0; i< heights.size();i++) {
            students.add(new Student(i + 1, heights.get(i), weights.get(i)));
        }
        students.sort((o1, o2) -> o1.height > o2.height ? 1 : o1.height == o2.height
                ? o1.weight - o2.weight : -1);
        System.out.println(students.stream().map(it -> String.valueOf(it.getNum())).collect(Collectors.joining(" ")));

    }

    static class Student{

        private int num;
        private int height;
        private int weight;

        public Student(int num, int height, int weight) {
            this.num = num;
            this.height = height;
            this.weight = weight;
        }

        public int getNum() {
            return num;
        }

        public void setNum(int num) {
            this.num = num;
        }

        public int getHeight() {
            return height;
        }

        public void setHeight(int height) {
            this.height = height;
        }

        public int getWeight() {
            return weight;
        }

        public void setWeight(int weight) {
            this.weight = weight;
        }
    }
}
